package org.com.structuralPattern.proxyPattern;

import java.util.Date;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/14 17:55
 */
public class GamePlayProxy implements IGamePlayer {

    private IGamePlayer player=null;

    public GamePlayProxy(IGamePlayer player){
        this.player=player;
    }
    //记录打怪日志

    private void log(){
        System.out.println("打怪时间"+new Date().toString());
    }

    public void killBoss() {
        this.log();
        player.killBoss();
    }


    public void upGrade() {
        player.upGrade();
        this.count();
    }

    private void count(){
        System.out.println("升级花费了3个小时");
    }
}
